/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.flexengine.scene;

import java.util.HashMap;
import java.util.Map;

/**
 * @author Luann R. Athayde
 * @version 1.0
 * @since 1.0
 */
public class SceneBundle {
    
    private Map<String, Object> extras;

    public SceneBundle(Map<String, Object> extras) {
        if( extras!=null ) {
            this.extras = extras;
        } else {
            this.extras = new HashMap<>();
        }
    }
    public SceneBundle() {
        this(null);
    }
    
    public Map<String, Object> getExtras() {
        return extras;
    }
    
    public <T> SceneBundle putExtra(String key, T value) {
        extras.put(key, value);
        return this;
    }
    
    public <T> T getExtra(String key) {
        return (T)extras.get(key);
    }
    
    public void clear() {
        extras.clear();
    }

    @Override
    public String toString() {
        return "SceneBundle{" + "extras=" + extras + '}';
    }
    
}
